home *** CD-ROM | disk | FTP | other *** search
- Path: wabbit.cc.uow.edu.au!not-for-mail
- From: tp86@wumpus.cc.uow.edu.au (PAOPENG THEERADECH)
- Newsgroups: comp.lang.c++
- Subject: float....question
- Date: 7 Feb 1996 01:24:49 +1100
- Organization: University of Wollongong, NSW, Australia.
- Message-ID: <4f7obh$lej@wumpus.cc.uow.edu.au>
- NNTP-Posting-Host: wumpus.cc.uow.edu.au
- X-Newsreader: NN version 6.5.0 #5
-
- Hello to all.
- I got the problem about "float" to ask you guys. I just try to write
- the simple program to handle the float. The program as below
-
- #include <iostream.h>
-
- main()
- {
- float Number;
-
- cout << "Please type the number in decimal point" << endl;
- cin >> Number;
- cout << "The number that you type in is: " << Number << endl;
- }
-
- When I type 5.5 in, I got the output as 5.49999999
- The number that i got from that program very close to the number that I just
- type in. Anyway, that not the number that I expect to got.
-
- Could anyone here please kind to tell me what wrong with this?????
-
- Please reply by e-mail if it possible.... :)
-
- Thanks in advance
-
- --
- T.Paopeng
- e-mail: tp86@wumpus.cc.uow.edu.au
-
-